<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://unpkg.com/vue@next"></script>
  <style>
  </style>
</head>
<body>
  <div id="app">
    <h3>Tooltips with Vue 3 Teleport</h3>
    <div id="parent">
      <parent-component></parent-component>
    </div>
  </div>

  <script>
    const app = Vue.createApp({
      
    })
    
    app.component('parent-component', {
      template: `
      <div>
        <h2>这是父组件</h2>
        <teleport to="#app">
          <child-component name="John">  
        </teleport>
      </div>
      `
    })

    app.component('child-component', {
      props: {
        name: String
      },
      template: `
      <div>Hello, {{ name }}</div>
      `
    })

    app.mount('#app')
  </script>
</body>
</html>